
*****************************************
*****************************************
****Presidential Campaigns and the Fundamentals Reconsidered
****Peter K. Enns and Brian Richman
****Journal of Politics
****Replication: Panel Data Analysis
*****************************************
*****************************************

***Set Working Directory
cd ""

use "EnnsRichman_NAESPanelDataAnalysis.dta", clear

xtset CKEY _stack

**Need to identify respondents from panel 1 whose concern for the election decreased
**or remained the same in subsequent panels
gen p1 = 0
recode p1 0=1 if dnot_int==. & f.dnot_int>=0 & f.dnot_int<=1

**Lack of relationship between campaign knowledge and decreases in caring about the election
xtreg  knowledge5 not_int mydate01 if dnot_int>=0 & dnot_int<=1 | p1==1, fe


**Table A-2
**Panel Data Analysis
**p1=1 means panel 1 respondents are only included if their lack of concern for election (i.e., motivation to satisfice)
**remained constant or increased (i.e., they became less concerned with the election).

xtreg  correct_pv15prob not_int if dnot_int>=0 & dnot_int<=1  | p1==1, fe
xtreg  correct_pv15prob not_int mydate01 knowledge5 exp401 if dnot_int>=0 & dnot_int<=1  | p1==1, fe

xtreg  correct_pv2prob not_int if dnot_int>=0 & dnot_int<=1  | p1==1, fe
xtreg  correct_pv2prob not_int mydate01 knowledge5 exp401 if dnot_int>=0 & dnot_int<=1  | p1==1, fe

**test that results robust to including date squared

xtreg  correct_pv15prob not_int mydate01 mydate01sq  knowledge5 exp401 if dnot_int>=0 & dnot_int<=1  | p1==1, fe

xtreg  correct_pv2prob not_int mydate01 mydate01sq  knowledge5 exp401 if dnot_int>=0 & dnot_int<=1  | p1==1, fe
drop p1
